<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- jsp文件头和头部 -->
<%@ include file="../../system/admin/top.jsp"%>

<!--查看图片插件 -->
<link rel="stylesheet" media="screen" type="text/css"
	href="plugins/zoomimage/css/zoomimage.css" />
<link rel="stylesheet" media="screen" type="text/css"
	href="plugins/zoomimage/css/custom.css" />
<script type="text/javascript" src="plugins/zoomimage/js/jquery.js"></script>
<script type="text/javascript" src="plugins/zoomimage/js/eye.js"></script>
<script type="text/javascript" src="plugins/zoomimage/js/utils.js"></script>
<script type="text/javascript" src="plugins/zoomimage/js/zoomimage.js"></script>
<script type="text/javascript" src="plugins/zoomimage/js/layout.js"></script>
<!--查看图片插件 -->

</head>
<body>
	<div class="container-fluid" id="main-container">
		<div id="main-content" class="clearfix">
			<div class="page-header position-relative">
				<tr>
					<td style="vertical-align: top;"width:80px;><c:if
							test="${QX.add == 1 }">
							<a class="btn btn-small btn-success"
								onclick="add('${pd.recordid}');">新增<i class="icon-pencil"></i></a>
						</c:if> <c:if test="${QX.cha == 1 }">
							<a class="btn btn-small btn-info"
								onclick="window.location.href=window.location.href;">刷新<i
								class="icon-refresh"></i></a>
						</c:if> <c:if test="${QX.del == 1 }">
							<a class="btn btn-small btn-danger"
								onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除">批量删除<i
								class='icon-trash'></i></a>
						</c:if> <c:if test="${QX.cha == 1 }">
							<a class="btn btn-small btn-info"
								onclick="location.href='<%=basePath%>/photo/list.do?id=';">返回相册<i
								class="icon-share-alt"></i></a>
						</c:if></td>
				</tr>
			</div>
			<!--#breadcrumbs-->



			<form action="pictures/list.do?recordid=${pd.recordid}" method="post"
				name="Form" id="Form">
				<div class="row-fluid">
					<!-- PAGE CONTENT BEGINS HERE -->
					<div class="row-fluid">
						<ul class="ace-thumbnails">
							<!-- 开始循环 -->
							<c:choose>
								<c:when test="${not empty varList}">
									<c:if test="${QX.cha == 1 }">
										<c:forEach items="${varList}" var="var" varStatus="vs">
											<li><label><input type='checkbox' name='ids'
													value="${var.PICTURES_ID}" /><span class="lbl"><span
														class="label label-info">${var.TITLE}</span></span></label> <a
												href="${var.PATH}" title="${var.TITLE}" class="bwGal"> <img
													alt="200x200" src="${var.PATH}"
													style="width: 200px; height: 200px;" />
											</a>
												<div class="tags">

													<span class="label label-warning arrowed-in">${var.CREATETIME}</span>
												</div> </a>
												<div class="tools tools-bottom">
													<c:if test="${QX.edit != 1 && QX.del != 1 && QX.cha != 1 }">
														<span
															class="label label-large label-grey arrowed-in-right arrowed-in"><i
															class="icon-lock" title="无权限"></i></span>
													</c:if>
														<c:if test="${QX.cha == 1 }">
														<a title="设置封面"
															onclick="cover('${var.PICTURES_ID}','${pd.recordid}');"><i
															class="icon-filter" title="设置封面"></i></a>
													</c:if>
													<a href="${var.PATH}" title="${var.TITLE}" class="bwGal">
														<i class="icon-zoom-in" title="查看大图"></i>
													</a>
													<c:if test="${QX.cha == 1 }">
														<a title="详细" onclick="find('${var.PICTURES_ID }');"><i
															class="icon-tasks" title="查看详细"></i></a>
													</c:if>
													<c:if test="${QX.edit == 1 }">
														<a title="编辑" onclick="edit('${var.PICTURES_ID}');"><i
															class="icon-pencil" title="编辑信息"></i></a>
													</c:if>
													<c:if test="${QX.del == 1 }">
														<a title="删除"
															onclick="del('${var.PICTURES_ID}','${var.PATH}');"><i
															class="icon-remove red" title="删除信息"></i></a>
													</c:if>
												
												</div></li>
										</c:forEach>
									</c:if>
									<c:if test="${QX.cha == 0 }">
										<tr>
											<td colspan="100" class="center">您无权查看</td>
										</tr>
									</c:if>
								</c:when>
								<c:otherwise>
									<tr class="main_info">
										<td colspan="100" class="center">没有相关数据</td>
									</tr>
								</c:otherwise>
							</c:choose>
						</ul>

					</div>
					<div class="pagination"
						style="float: inherit; padding-top: 0px; margin-top: 0px;">${page.pageStr}</div>
					<!-- PAGE CONTENT ENDS HERE -->
				</div>
			</form>
			<!--/row-->

		</div>
		<!--/#page-content-->

	</div>
	<!-- #main-content -->
	</div>
	<!--/.fluid-container#main-container-->

	<!-- 引入 -->
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
	<script src="static/js/bootstrap.min.js"></script>
	<script src="static/js/ace-elements.min.js"></script>
	<script src="static/js/ace.min.js"></script>
	<!-- 引入 -->
	<script type="text/javascript">
		
		$(top.hangge());
		
		//检索
		function search(){
			top.jzts();
			$("#Form").submit();
		}
		//清空检索
		function empty(){
			$(':input','#Form').not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');
		}
		//新增
		function add(Id){
			 top.jzts();
			 var diag = new top.Dialog();
			 diag.Drag=true;
			 diag.Title ="新增";
			 diag.URL = '<%=basePath%>pictures/goAdd.do?recordid='+Id;
			 diag.Width = 800;
			 diag.Height = 490;
			 diag.CancelEvent = function(){ //关闭事件
				 if('${page.currentPage}' == '0'){
					 top.jzts();
					 setTimeout("self.location=self.location",100);
				 }else{
					 nextPage(${page.currentPage});
				 }
				diag.close();
			 };
			 diag.show();
		}
		
		//删除
		function del(Id,PATH){
			
			if(confirm("确定要删除?")){ 
				top.jzts();
				var url = "<%=basePath%>pictures/delete.do?PICTURES_ID="+Id+"&PATH="+PATH+"&tm="+new Date().getTime();
				$.get(url,function(data){
					nextPage(${page.currentPage});
				});
			}
		}
		//设置相册封面
		function cover(Pid,id){
			top.jzts();
			var url = "<%=basePath%>photo/edit.do?id="+id+"&coverid="+Pid+"&tm="+new Date().getTime();
			$.get(url,function(data){
				nextPage(${page.currentPage});
			});
		}
		
		//修改
		function edit(Id){
			 top.jzts();
			 var diag = new top.Dialog();
			 diag.Drag=true;
			 diag.Title ="编辑";
			 diag.URL = '<%=basePath%>pictures/goEdit.do?PICTURES_ID='+Id;
			 diag.Width = 600;
			 diag.Height = 465;
			 diag.CancelEvent = function(){ //关闭事件
				 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
					 nextPage(${page.currentPage});
				}
				diag.close();
			 };
			 diag.show();
		}
		
		//详细
		function find(Id){
			 top.jzts();
			 var diag = new top.Dialog();
			 diag.Drag=true;
			 diag.Title ="详细";
			 diag.URL = '<%=basePath%>pictures/goFind.do?PICTURES_ID='+Id;
			 diag.Width = 600;
			 diag.Height = 465;
			 diag.CancelEvent = function(){ //关闭事件
				 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
					 nextPage(${page.currentPage});
				}
				diag.close();
			 };
			 diag.show();
		}
	
		
		</script>

	<script type="text/javascript">
		
	//批量操作
	function makeAll(msg){
		bootbox.confirm(msg, function(result) {
			if(result) {
				var str = '';
				var emstr = '';
				var phones = '';
				for(var i=0;i < document.getElementsByName('ids').length;i++)
				{
					  if(document.getElementsByName('ids')[i].checked){
					  	if(str=='') str += document.getElementsByName('ids')[i].value;
					  	else str += ',' + document.getElementsByName('ids')[i].value;
					  	
					  }
				}
				if(str==''){
					bootbox.dialog("您没有选择任何内容!", 
						[
						  {
							"label" : "关闭",
							"class" : "btn-small btn-success",
							"callback": function() {
								//Example.show("great success");
								}
							}
						 ]
					);
					
					$("#zcheckbox").tips({
						side:3,
			            msg:'点这里全选',
			            bg:'#AE81FF',
			            time:8
			        });
					
					return;
				}else{
					if(msg == '确定要删除选中的数据吗?'){
						top.jzts();
						$.ajax({
							type: "POST",
							url: '<%=basePath%>uuser/deleteAllU.do?tm='+new Date().getTime(),
					    	data: {USER_IDS:str},
							dataType:'json',
							//beforeSend: validateData,
							cache: false,
							success: function(data){
								 $.each(data.list, function(i, list){
										nextPage(${page.currentPage});
								 });
							}
						});
					}else if(msg == '确定要给选中的用户发送邮件吗?'){
						sendEmail(emstr);
					}else if(msg == '确定要给选中的用户发送短信吗?'){
						sendSms(phones);
					}
					
					
				}
			}
		});
	}
	
		
		
		//批量操作
		function makeAll(msg){
			
			if(confirm(msg)){ 
				
					var str = '';
					for(var i=0;i < document.getElementsByName('ids').length;i++)
					{
						  if(document.getElementsByName('ids')[i].checked){
						  	if(str=='') str += document.getElementsByName('ids')[i].value;
						  	else str += ',' + document.getElementsByName('ids')[i].value;
						  }
					}
					if(str==''){
						alert("您没有选择任何内容!"); 
						return;
					}else{
						if(msg == '确定要删除选中的数据吗?'){
							top.jzts();
							$.ajax({
								type: "POST",
								url: '<%=basePath%>pictures/deleteAll.do?tm='+new Date().getTime(),
						    	data: {DATA_IDS:str},
								dataType:'json',
								//beforeSend: validateData,
								cache: false,
								success: function(data){
									 $.each(data.list, function(i, list){
											nextPage(${page.currentPage});
									 });
								}
							});
						}
					}
			}
		}
		
		//导出excel
		function toExcel(){
			window.location.href='<%=basePath%>pictures/excel.do';
		}
		</script>
	<style type="text/css">
li {
	list-style-type: none;
}
</style>
	<ul class="navigationTabs">
		<li><a></a></li>
		<li></li>
	</ul>
</body>
</html>

